# Contributor: Galen Abell <galen@galenabell.com>
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=whipper
pkgver=0.10.0
pkgrel=4
pkgdesc="python CD-DA ripper preferring accuracy over speed"
# https://github.com/whipper-team/whipper/issues/515
options="net !check"
url="https://github.com/whipper-team/whipper"
arch="all !armhf !armv7 !x86" # TODO tests fail on armv7 and x86, ref whipper issue #429
license="GPL-3.0-only"
depends="
	python3
	libcdio-paranoia
	cdrdao
	gobject-introspection
	py3-gobject3
	py3-musicbrainzngs
	py3-mutagen
	py3-requests
	py3-cdio
	py3-discid
	py3-ruamel.yaml
	flac
	sox
"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-setuptools_scm
	python3-dev
	py3-wheel
	libsndfile-dev
	"
checkdepends="py3-twisted"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/whipper-team/whipper/archive/v$pkgver.tar.gz"

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION="$pkgver"

	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m unittest discover
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
728ad98185aa2d29f4fb215a597136691bb2c3590b3cac4f659238f90a3b4328c377fafe830a725b655f050538739f404b3eca853db4c39001d1b9d721dc7fd8  whipper-0.10.0.tar.gz
"
